package org.test.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Timer;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

public class MainEntryPoint implements EntryPoint {

    public MainEntryPoint() {
    }

    
    public void onModuleLoad() {
          MyBinderWidget w = new MyBinderWidget();
		  Collection users = Factory.getInstance().getCrumbsUserDAO().getAllCrumbsUser();
          RootPanel.get().add(w);
       /* final Label label = new Label("Hello, GWT!!!");
        final Label lb = new Label ("MY NEW LABEL");
        final Button button = new Button("Click me!");
        
        button.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                label.setVisible(!label.isVisible());
            }
        });
        
        
        RootPanel.get().add(button);
        RootPanel.get().add(label);
        RootPanel.get().add(lb);
        * 
        * */
    // RootPanel.get().add(new GWTServiceUsageExample());
       /*final Label quoteText = new Label();

    Timer timer = new Timer() {

        public void run() {
            //create an async callback to handle the result:
            AsyncCallback callback = new AsyncCallback() {

                public void onFailure(Throwable arg0) {
                    //display error text if we can't get the quote:
                    quoteText.setText("Failed to get a quote");
                }

                public void onSuccess(Object result) {
                    //display the retrieved quote in the label:
                    quoteText.setText((String) result);
                    quoteText.setStyleName("quoteLabel");
                }
            };
            getService().myMethod(callback);
        }
    };

    timer.scheduleRepeating(1000);
    RootPanel.get().add(quoteText);
    
    */
    }
    
     public static GWTServiceAsync getService() {
        // Create the client proxy. Note that although you are creating the
        // service interface proper, you cast the result to the asynchronous
        // version of the interface. The cast is always safe because the
        // generated proxy implements the asynchronous interface automatically.

        return GWT.create(GWTService.class);
    }
}
